package com.huatai.datacenter.controller.test.controller;

import cn.hutool.core.date.DateTime;
import com.huatai.datacenter.controller.test.dto.domain.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * packageName com.huatai.datacenter.controller.test.controller
 *
 * @author gaowengui
 * @version JDK 8
 * @className TopicViewController
 * @date 2025/6/19
 * @description TODO
 */
@RestController
@RequestMapping("/topic/view")
public class TopicViewController {

    @GetMapping("/alarm/record")//消防报警记录表（消防战时分析）  tb_fire_alarm_record
    public List<TbFireAlarmRecord> getAlarmRecord() {
        List<TbFireAlarmRecord> list = new ArrayList<>();
        list.add(new TbFireAlarmRecord("1","贵阳市云岩区未来方舟D3组团南门","居民区域","社会救助","云岩区",new DateTime("2025-05-31 15:10:01"),"云岩大队","8","8","3","1","2",1));
        list.add(new TbFireAlarmRecord("2","贵阳市南明区海天装饰大厦B门","经营场所","抢险救援","南明区",new DateTime("2025-05-31 21:15:55"),"南明大队","6","6","1","0","1",0));
        return list;
    }

    @GetMapping("/safety/situation")//消防重点部位安全情况表（消防安全预警） tb_fire_safety_situation
    public List<TbFireSafetySituation> getSafetySituation() {
        List<TbFireSafetySituation> list = new ArrayList<>();
        //list.add(new TbFireSafetySituation("safe-unit-1","贵阳市红城美元化工有限公司","观山湖区","106.672054","26.624761","廖凯","137****6496","37","54","1","东南风","12","14","1","1","0","0"));
        list.add(new TbFireSafetySituation(
                "safe-unit-1", "贵阳市红城美元化工有限公司", "观山湖区", "106.672054", "26.624761", "廖凯", "137****6496", "37", "54", "1", "东南风", "12", "14", "1", "1", "0", "0"));
        list.add(new TbFireSafetySituation(
                "safe-unit-10", "开磷集团第三磷融工厂", "开阳县", "106.858794", "27.11992", "蒋烈奇", "131****3674", "19", "50", "2", "南风", "15", "15", "0", "0", "0", "0"));

        list.add(new TbFireSafetySituation(
                "safe-unit-2", "贵阳市名城西苑商贸中心", "云岩区", "106.725746", "26.598694", "肖喜祥", "185****1636", "22", "22", "1", "南风", "5117", "2415", "1", "0", "1", "0"));
        list.add(new TbFireSafetySituation(
                "safe-unit-3", "贵阳市南明海贸商业街", "南明区", "106.750683", "26.571006", "龙溪东", "133****7702", "23", "56", "2", "东南风", "12", "13", "0", "0", "0", "0"));
        list.add(new TbFireSafetySituation(
                "safe-unit-4", "贵州大学北校区朝阳村", "花溪区", "106.681113", "26.446166", "陆德明", "150****1429", "22", "45", "1", "南风", "14", "15", "0", "0", "0", "0"));

        list.add(new TbFireSafetySituation(
                "safe-unit-5", "为明学校保利春天校区", "乌当区", "106.784004", "26.632176", "赵星星", "189****8696", "22", "57", "2", "南风", "13", "17", "1", "0", "0", "1"));

        list.add(new TbFireSafetySituation(
                "safe-unit-6", "贵州科学城", "白云区", "106.665476", "26.728426", "孙志祥", "177****5631", "24", "53", "2", "东风", "20", "11", "0", "0", "0", "0"));

        list.add(new TbFireSafetySituation(
                "safe-unit-7", "清镇职教城", "清镇市", "106.478118", "26.592793", "孟德禄", "135****9097", "21", "51", "1", "东风", "15", "18", "0", "0", "0", "0"));

        list.add(new TbFireSafetySituation(
                "safe-unit-8", "息烽县邬氹工业园区", "息烽县", "106.746317", "27.094682", "敖兴海", "185****1435", "19", "50", "2", "东风", "277", "305", "0", "0", "0", "0"));

        list.add(new TbFireSafetySituation(
                "safe-unit-9", "猕天大圣蔬果物流园区", "修文县", "106.615596", "26.828776", "谢天兴", "177****2574", "20", "51", "2", "东风", "19", "12", "0", "0", "0", "0"));
        return list;

    }

    @GetMapping("/safetyhazard/record")//消防安全隐患记录表（消防安全预警） tb_fire_safety_hazard_record
    public List<TbFireSafetyHazardRecord> getSafetyHazardRecord() {
        List<TbFireSafetyHazardRecord> list = new ArrayList<>();
        list.add(new TbFireSafetyHazardRecord("safe-alarm-1","线路温度异常","用电隐患告警","2025-05-30 15:33:41","执行消防重点部位巡察-贵阳市红城美元化工有限公司","齐峰","防火处","2025-05-30 15:33:41","2025-05-30 15:45:33","已解决","贵阳市红城美元化工有限公司","观山湖区","廖凯","13797146496","37","54","1","东南风","12","14",1));
        list.add(new TbFireSafetyHazardRecord("safe-alarm-2","烟感主机告警异常","主机告警","2025-05-30 14:30:30","执行消防重点部位巡察-贵阳市名城西苑商贸中心","齐峰","防火处","2025-05-30 14:30:30","2025-05-30 14:37:35","已解决","贵阳市名城西苑商贸中心","云岩区","肖喜祥","18585051636","22","22","1","南风","5117","2415",1));
        list.add(new TbFireSafetyHazardRecord("safe-alarm-3","高位水箱水位异常","用水隐患告警","2025-05-31 11:33:11","执行消防重点部位巡察-为明学校保利春天校区","齐峰","防火处","2025-05-31 11:33:11","2025-05-31 11:36:27","已解决","为明学校保利春天校区","乌当区","赵星星","18908518696","22","57","2","南风","13","17",	1));
        return list;
    }

    @GetMapping("/brigade/stationcapacity")//消防队站能力表（消防战时分析） tb_fire_brigade_station_capacity
    public List<TbFireBrigadeStationCapacity> getBrigadeStationcapacity(){
        List<TbFireBrigadeStationCapacity> list = new ArrayList<>();
        //list.add(new TbFireBrigadeStationCapacity("team-1","特勤大队",21,10,4,1,1,6,5));
        list.add(new TbFireBrigadeStationCapacity("team-1", "特勤大队", 21, "10", 4, 1, 1, 6, 5));
        list.add(new TbFireBrigadeStationCapacity("team-10", "修文大队", 0, "0", 0, 0, 0, 20, 11));
        list.add(new TbFireBrigadeStationCapacity("team-11", "息烽大队", 0, "0", 0, 0, 0, 20, 12));
        list.add(new TbFireBrigadeStationCapacity("team-12", "开阳大队", 0, "0", 0, 0, 0, 20, 0));
        list.add(new TbFireBrigadeStationCapacity("team-13", "司令部", 24, "0", 5, 2, 3, 0, 0));
        list.add(new TbFireBrigadeStationCapacity("team-14", "后勤处", 36, "0", 0, 0, 0, 0, 0));
        list.add(new TbFireBrigadeStationCapacity("team-15", "防火处", 28, "36", 0, 0, 0, 0, 0));
        list.add(new TbFireBrigadeStationCapacity("team-16", "政治处", 25, "0", 0, 0, 0, 0, 0));
        list.add(new TbFireBrigadeStationCapacity("team-2", "观山湖大队", 44, "25", 5, 2, 2, 20, 8));
        list.add(new TbFireBrigadeStationCapacity("team-3", "南明大队", 11, "6", 1, 0, 1, 20, 15));
        list.add(new TbFireBrigadeStationCapacity("team-4", "花溪大队", 0, "0", 0, 0, 0, 20, 0));
        list.add(new TbFireBrigadeStationCapacity("team-5", "云岩大队", 15, "8", 3, 1, 2, 20, 12));
        list.add(new TbFireBrigadeStationCapacity("team-6", "白云大队", 0, "0", 0, 0, 0, 20, 10));
        list.add(new TbFireBrigadeStationCapacity("team-7", "乌当大队", 0, "0", 0, 0, 0, 20, 11));
        list.add(new TbFireBrigadeStationCapacity("team-8", "经开大队", 0, "0", 0, 0, 0, 20, 15));
        list.add(new TbFireBrigadeStationCapacity("team-9", "清镇大队", 0, "0", 0, 0, 0, 20, 14));
        return list;
    }

    @GetMapping("/water/source")//水源情况表（消防战时分析）tb_fire_water_source_situation
    public List<TbFireWaterSourceSituation> getWaterSource(){
        List<TbFireWaterSourceSituation> list = new ArrayList<>();
       // list.add(new TbFireWaterSourceSituation("district-1","观山湖区","242","15"));
        list.add(new TbFireWaterSourceSituation("district-1", "观山湖区", "242", "15"));
        list.add(new TbFireWaterSourceSituation("district-10", "开阳县", "134", "33"));
        list.add(new TbFireWaterSourceSituation("district-2", "云岩区", "132", "16"));
        list.add(new TbFireWaterSourceSituation("district-3", "南明区", "135", "10"));
        list.add(new TbFireWaterSourceSituation("district-4", "花溪区", "144", "7"));
        list.add(new TbFireWaterSourceSituation("district-5", "乌当区", "142", "27"));
        list.add(new TbFireWaterSourceSituation("district-6", "白云区", "158", "21"));
        list.add(new TbFireWaterSourceSituation("district-7", "清镇市", "266", "16"));
        list.add(new TbFireWaterSourceSituation("district-8", "息烽县", "137", "18"));
        list.add(new TbFireWaterSourceSituation("district-9", "修文县", "138", "29"));
        return list;
    }

    @GetMapping("/event/recordform")//事项记录表(消防综合事务) tb_fire_event_record_form
    public List<TbFireEventRecordForm> getEventRecordForm(){
        List<TbFireEventRecordForm> list = new ArrayList<>();
        //list.add(new TbFireEventRecordForm("t1","执行消防重点部位巡察-贵阳市红城美元化工有限公司","重点部位巡察","齐峰","防火处",new Date("2025-05-30 15:33:41"),new Date("2025-05-30 15:38:41"),new Date("2025-05-30 15:45:33")));
        list.add(new TbFireEventRecordForm(
                "t1", "执行消防重点部位巡察-贵阳市红城美元化工有限公司", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-30 15:33:41"), new DateTime("2025-05-30 15:38:41"), new DateTime("2025-05-30 15:45:33")
        ));

        list.add(new TbFireEventRecordForm(
                "t2", "执行消防重点部位巡察-贵阳市名城西苑商贸中心", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-30 14:30:30"), new DateTime("2025-05-30 14:35:30"), new  DateTime("2025-05-15 14:37:35") // 注意：提交时间早于执行时间
        ));

        list.add(new TbFireEventRecordForm(
                "t3", "执行消防重点部位巡察-为明学校保利春天校区", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-31 11:33:11"), new DateTime("2025-05-31 11:38:11"), new DateTime("2025-05-31 11:36:27") // 注意：提交时间早于结束时间
        ));

        list.add(new TbFireEventRecordForm(
                "t4", "防火处专项工作督查督办会", "三重一大会议", "齐峰", "防火处", new DateTime("2025-05-31 10:30:00"), new DateTime("2025-05-31 11:50:41"), new DateTime("2025-05-31 11:50:41") // 结束与提交时间相同
        ));
        return list;
    }

    @GetMapping("/evaluation/record")//考核记录表(消防人员效能) tb_fire_evaluation_record
    public List<TbFireEvaluationRecord> getEvaluationRecord(){
        List<TbFireEvaluationRecord> list = new ArrayList<>();
        list.add(new TbFireEvaluationRecord("kp1","党建政治教育考评","红门政教","齐峰","防火处",new DateTime("2025-05-05"), 96.0));
        list.add(new TbFireEvaluationRecord("kp2","5月干部绩效考评","干部绩效考评","齐峰","防火处",new DateTime("2025-05-31"), 91.0));
        list.add(new TbFireEvaluationRecord("kp3","党建政治教育考评","红门政教","齐峰","防火处",new DateTime("2025-05-31"), 94.0));
        return list;
    }

    @GetMapping("/working/pressure")//消防工作压力记录表(消防人员效能) tb_fire_working_pressure
    public List<TbFireWorkingPressure> getWorkingPressure(){
        List<TbFireWorkingPressure> list = new ArrayList<>();
        //list.add(new TbFireWorkingPressure("t1","执行消防重点部位巡察-贵阳市红城美元化工有限公司","重点部位巡察","齐峰","防火处",new DateTime("2025-05-30 15:33:41"),new DateTime("2025-05-30 15:45:33"),new DateTime("2025-05-30 15:38:41")));
        list.add(new TbFireWorkingPressure(
                "t1", "执行消防重点部位巡察-贵阳市红城美元化工有限公司", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-30 15:33:41"), new DateTime("2025-05-30 15:45:33"), new DateTime("2025-05-30 15:38:41")
        ));

        list.add(new TbFireWorkingPressure(
                "t2", "执行消防重点部位巡察-贵阳市名城西苑商贸中心", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-30 14:30:30"), new DateTime("2025-05-30 14:37:35"), new DateTime("2025-05-30 14:35:30")
        ));

        list.add(new TbFireWorkingPressure(
                "t3", "执行消防重点部位巡察-为明学校保利春天校区", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-31 11:33:11"), new DateTime("2025-05-31 11:36:27"), new DateTime("2025-05-31 11:38:11")
        ));

        list.add(new TbFireWorkingPressure(
                "t4", "防火处专项工作督查督办会", "三重一大会议", "齐峰", "防火处", new DateTime("2025-05-31 10:30:00"), new DateTime("2025-05-31 11:50:41"), new DateTime("2025-05-31 11:50:41")
        ));
        return list;
    }

    @GetMapping("/response/speed")//消防响应速度记录表(消防人员效能) tb_fire_response_speed
    public List<TbFireResponseSpeed> getResponseSpeed(){
        List<TbFireResponseSpeed> list = new ArrayList<>();
        list.add(new TbFireResponseSpeed(
                "t1", "执行消防重点部位巡察-贵阳市红城美元化工有限公司", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-30 15:33:41"), new DateTime("2025-05-30 15:38:41"), new DateTime("2025-05-30 16:45:33")
        ));

        list.add(new TbFireResponseSpeed(
                "t2", "执行消防重点部位巡察-贵阳市名城西苑商贸中心", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-30 14:30:30"), new DateTime("2025-05-30 14:35:30"), new DateTime("2025-05-30 14:37:35")
        ));

        list.add(new TbFireResponseSpeed(
                "t3", "执行消防重点部位巡察-为明学校保利春天校区", "重点部位巡察", "齐峰", "防火处", new DateTime("2025-05-31 11:33:11"), new DateTime("2025-05-31 11:38:11"), new DateTime("2025-05-31 11:38:00")
        ));
        return list;
    }

    @GetMapping("/generic/plan")// 消防预案表（B） tb_xf_generic_plan_b
    public List<TbXfGenericPlanB> getGenericPlan(){
        List<TbXfGenericPlanB> list = new ArrayList<>();
        //list.add(new TbXfGenericPlanB("team-1","特勤大队",6,5));
        list.add(new TbXfGenericPlanB("team-1", "特勤大队", 6, 5));
        list.add(new TbXfGenericPlanB("team-10", "修文大队", 20, 11));
        list.add(new TbXfGenericPlanB("team-11", "息烽大队", 20, 12));
        list.add(new TbXfGenericPlanB("team-12", "开阳大队", 20, 5));
        list.add(new TbXfGenericPlanB("team-13", "司令部", null, null));  // 注意这里require和finished为null
        list.add(new TbXfGenericPlanB("team-14", "后勤处", null, null));
        list.add(new TbXfGenericPlanB("team-15", "防火处", null, null));
        list.add(new TbXfGenericPlanB("team-16", "政治处", null, null));
        list.add(new TbXfGenericPlanB("team-2", "观山湖大队", 20, 8));
        list.add(new TbXfGenericPlanB("team-3", "南明大队", 20, 15));
        list.add(new TbXfGenericPlanB("team-4", "花溪大队", 20, 2));
        list.add(new TbXfGenericPlanB("team-5", "云岩大队", 20, 12));
        list.add(new TbXfGenericPlanB("team-6", "白云大队", 20, 10));
        list.add(new TbXfGenericPlanB("team-7", "乌当大队", 20, 11));
        list.add(new TbXfGenericPlanB("team-8", "经开大队", 20, 15));
        list.add(new TbXfGenericPlanB("team-9", "清镇大队", 20, 14));
        return list;
    }
}
